package com.ciwong.epaper.modules.me.bean;

import android.support.annotation.NonNull;

import java.util.ArrayList;
import java.util.List;

public class MaterialClassificationBean implements Comparable<MaterialClassificationBean> {
    /*//教材版本*/
    /**
     * books : [{"bookId":2743,"bookName":"xpj测试环境书1"},{"bookId":3162,"bookName":"听说模考"},{"bookId":3164,"bookName":"听说模考-副本"},{"bookId":2904,"bookName":"xpj图片书1"},{"bookId":2953,"bookName":"七年级下册同步听力训练"}]//该教材版本书的书列表
     * gradeId : 1107//年级ID
     * gradeName : 七年级//年级名称
     * semester : 1201 //学期（1201：上学期  1202：下学期  1203:全册）
     * versionId : 327 //教材版本ID
     * versionName : 人教版 //教材版本名称
     */


    /**
     * 年级名字加 学期 ex 一年级上学期
     */
    public static final int  LAST_SEMESTER=1201;//1201：上学期
    public  static final int  NEXT_SEMESTER=1202;// 1202：下学期
    public static final  int  ALL_SEMESTER=1203;//1203:全册
    private String gradeName_plus;
    private List<MaterialBean> materialBeanList;
    private int gradeId;
    private int semester;

    public boolean isSelect() {
        return isSelect;
    }

    public void setSelect(boolean select) {
        isSelect = select;
    }

    private boolean isSelect;
    public String getGradeName_plus() {
        return gradeName_plus;
    }

    public void setGradeName_plus(String gradeName_plus) {
        this.gradeName_plus = gradeName_plus;
    }

    public List<MaterialBean> getMaterialBeanList() {
        return materialBeanList;
    }

    public void setMaterialBeanList(List<MaterialBean> materialBeanList) {
        this.materialBeanList = materialBeanList;
    }

    public int getGradeId() {
        return gradeId;
    }

    public void setGradeId(int gradeId) {
        this.gradeId = gradeId;

    }

    public int getSemester() {
        return semester;
    }

    public void setSemester(int semester) {
        this.semester = semester;
    }


    @Override
    public int compareTo(@NonNull MaterialClassificationBean o) {
        if (this.gradeId > o.getGradeId())
            return 1;
        else if (this.gradeId < o.getGradeId())
            return -1;
        else{
            if (this.semester<o.getSemester())
                return 1;
            else if (this.semester>o.getSemester())
                return -1;
            else
                return 0;
        }
    }

}